let fm = new FormData();
      //1、拿到上传文件的内容
      let pt = document.querySelector("input");
      let img = document.querySelector("img");
      pt.addEventListener("change", async function () {
        //通过 this.files拿取上传的文件
        console.log(this.files);
        //做本地预览
        //将地址给到我们img的src
        let objUrl = URL.createObjectURL(this.files[0]);
        img.src = objUrl;
        //处理数据添加到服务器中
        fm.append("headimgurl", this.files[0]);
        let result = await fetch("http://chst.vip/students/uploadStuAvatar", {
          method: "post",
          body: fm,
        }).then((res) => res.json());
      });
